Skip to content

"Fix" bug 22175: cdstreq should always use ES:DI for 16-size structs (DO NOT MERGE- but, please, help?)#13255

Closed
FeepingCreature wants to merge 1 commit intodlang:masterfrom
FeepingCreature:fix/bug-22175-experimental-backend-poking
Closed

"Fix" bug 22175: cdstreq should always use ES:DI for 16-size structs (DO NOT MERGE- but, please, help?)#13255
FeepingCreature wants to merge 1 commit intodlang:masterfrom
FeepingCreature:fix/bug-22175-experimental-backend-poking

Conversation

@FeepingCreature
Copy link
Contributor

@FeepingCreature FeepingCreature commented Nov 2, 2021

Do not merge! I definitely don't understand what I'm doing here! This is presented as a request for comments!

Okay.

Something very weird is going on with 22175. It needs to do a struct assignment from AX|DX, because it's trying to ?: merge a 9-byte (that is, rounded up to 16-byte) struct. But it falls into a codepath in cdstreq where I think it thinks it's trying to work with pointers? So it does some sort of weird fixup and then decides to only use DI, not DI|ES, because we're on x86_64 and we don't need segment addressing (ES:DI) there. But we're working with a streq elem, and the result of that isn't a pointer to begin with?? So then we're stuck trying to fit a 16-byte result in a 8-byte register and crash.

The PR just removes that EX_flat check, which gives it enough space to fit AX|DX into. This seems to pass the testsuite, so technically it's a fix, but the goal here is more to get some eyes on that codepath than to get this PR merged.

Help pls? 🥺

@dlang-bot
Copy link
Contributor

Thanks for your pull request and interest in making D better, @FeepingCreature! We are looking forward to reviewing it, and you should be hearing from a maintainer soon.
Please verify that your PR follows this checklist:

  • My PR is fully covered with tests (you can see the coverage diff by visiting the details link of the codecov check)
  • My PR is as minimal as possible (smaller, focused PRs are easier to review than big ones)
  • I have provided a detailed rationale explaining my changes
  • New or modified functions have Ddoc comments (with Params: and Returns:)

Please see CONTRIBUTING.md for more information.


If you have addressed all reviews or aren't sure how to proceed, don't hesitate to ping us with a simple comment.

Bugzilla references

Auto-close Bugzilla Severity Description
22175 regression Nested method access to variable formed by ternary of constructor and function call, of a struct with four shorts and a bool, crashes DMD.

Testing this PR locally

If you don't have a local development environment setup, you can use Digger to test this PR:

dub run digger -- build "master + dmd#13255"

@FeepingCreature FeepingCreature changed the title "Fix" bug 22175: cdstreq should always use ES:DI for 16-size structs (DO NOT MERGE) "Fix" bug 22175: cdstreq should always use ES:DI for 16-size structs (DO NOT MERGE- but, please, help?) Nov 4, 2021
@RazvanN7
Copy link
Contributor

RazvanN7 commented Nov 9, 2021

cc @WalterBright

@RazvanN7
Copy link
Contributor

RazvanN7 commented Jan 5, 2022

ping @WalterBright , could you give us some pointers?

… or not we're on a platform with segmented access.
@FeepingCreature FeepingCreature force-pushed the fix/bug-22175-experimental-backend-poking branch from 3a34ec2 to 38b3280 Compare March 8, 2022 11:19
@FeepingCreature
Copy link
Contributor Author

FeepingCreature commented Mar 8, 2022

Okay, what's up here? Pushed a rebase... I'm still not really up with merging this, but it doesn't seem like anything else is going to happen here? I guess I'd rather have the commit in than not, if those are the only two options on the table?

@WalterBright
Copy link
Member

This is the PR that caused the regression: #12409

@WalterBright
Copy link
Member

This fix doesn't work because it needs to do a dereference of DI. Replaced with #13788

@FeepingCreature FeepingCreature deleted the fix/bug-22175-experimental-backend-poking branch March 9, 2022 10:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

Comments